<?php
   @$sid=$_GET['sid'];
   //echo $prompt;
   //认证
   $time = time();
   $auth = md5(''.$time);
   $text = utf8_encode($auth);
   $rawHmac = hash_hmac('sha1', $text, '', true);
   $signature = base64_encode($rawHmac);
   $curl = curl_init();

curl_setopt_array($curl, array(
   CURLOPT_URL => 'https://zwapi.xfyun.cn/api/aippt/progress?sid='.$sid,
   CURLOPT_RETURNTRANSFER => true,
   CURLOPT_ENCODING => '',
   CURLOPT_MAXREDIRS => 10,
   CURLOPT_TIMEOUT => 0,
   CURLOPT_FOLLOWLOCATION => true,
   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
   CURLOPT_CUSTOMREQUEST => 'GET',
   
   CURLOPT_HTTPHEADER => array(
      "appId:018b315f",
      "timestamp: $time",
      "signature: $signature",
      "Content-Type: application/json; charset=utf-8"
   ),
));
$response = curl_exec($curl);

curl_close($curl);
//header('Refresh: 5');
//print_r(json_decode($response)->data->pptUrl);
@$url = json_decode($response)->data->pptUrl;
echo '<script>window.location.href = "'.$url.'";</script>';


?>
